#!usr/bin/env python
# *- coding:utf-8 -*-
# Andy Create @ 10/22/2019 5:58 PM

# from django.utils.deprecation import MiddlewareMixin
# from django.urls import reverse
# from django.shortcuts import redirect, HttpResponse, render
#
#
# class Auth(MiddlewareMixin):
#     # if not login redirect to login
#     white_list = [reverse('sales:login'), reverse('sales:register'), ]
#
#     def process_request(self, request):
#         if request.path not in self.white_list:
#             username = request.session.get('username')
#             if not username:
#                 return redirect('sales:login')
